module JK_FF(
           clk,
           rst_n,
           J,
           K,
           Q
       );
input clk;
input rst_n;
input J;
input K;
output reg Q;
always@(posedge clk or negedge rst_n)
	begin
		if (!rst_n)
			Q <= 1'b0;
		else
			Q <= (J & ~Q) | (~K & Q);
	end
/*查找表
always@(posedge clk)
    case({J,K})
        2'b00:Q<=Q;
        2'b01:Q<=1'b0;
        2'b10:Q<=1'b0;
        2'b11:Q<=~Q;
    endcase
*/
endmodule
